package be.jabapage.snooker.service.overwriter.impl;

import java.io.Serializable;

import org.apache.commons.lang.Validate;

import be.jabapage.snooker.jdo.administration.Player;
import be.jabapage.snooker.service.overwriter.api.IPlayerOverwriter;

/**
 * Overwrite the player by only setting the ID;
 * @author axesq
 *
 */
public class SimplePlayerOverwriter implements IPlayerOverwriter, Serializable {

	private static final long serialVersionUID = -4435895344164830269L;

	/**
	 * {@inheritDoc}
	 */
	public void overwrite(final Player source, final Player target) {
		Validate.notNull(source);
		Validate.notNull(target);
		target.setId(source.getId());
	}

}
